const Router = require("koa-router");
const manage = require("./manage");
const web = require("./web");
const nomatch = require("./nomatch");
const router = new Router();

router.get("/", async (ctx) => {
  ctx.body = "根路径";
});

router.use("/manage", manage.routes(), manage.allowedMethods());
router.use("/web", web.routes(), web.allowedMethods());
router.use("/404", nomatch.routes(), nomatch.allowedMethods());
//如果前端请求了/路径，那么重定向到/manage 让前端请求/manage的接口数据
router.redirect("/", "/manage");

module.exports = router;
